package com.example.demo.sys.mapper;

import com.example.demo.sys.entity.Coursecheckform;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口 chrimer
 * </p>
 *
 * @author chimer
 * @since 2020-06-22
 */
public interface CoursecheckformMapper<Int> extends BaseMapper<Coursecheckform> {
    @Update("UPDATE coursecheckform SET status=#{status} WHERE id=#{id}")
    void updateuseful(String id, Int status);

     @Select("Select * from coursecheckform")
    List<Coursecheckform> Select();


    @Select("Select * from coursecheckform WHERE courseType=#{type} and status=#{status}")
    List<Coursecheckform> SelectT(String type,int status);

    @Select("Select * from coursecheckform WHERE courseType=#{type} and status = #{status} and courseName like CONCAT('%',#{courseName},'%')")
    List<Coursecheckform> SelectTT(String type,String courseName,int status);

    @Select("Select courseType from coursetype")
    List<String> SelectType();

    @Delete("Delete from coursemanager WHERE courseId = #{courseId}")
    void DeleteCoursemananger(String courseId);

    @Delete("Delete from classdiscuss WHERE courseId = #{courseId}")
    void DeleteDiscuss(String courseId);

    @Delete("Delete from coursevideo WHERE courseId = #{courseId}")
    void DeleteVideo(String courseId);

    @Delete("Delete from forum WHERE courseId = #{courseId}")
    void DeleteForum(String courseId);

    @Delete("Delete from studentwork WHERE courseId = #{courseId}")
    void DeleteStudentWork(String courseId);

    @Delete("Delete from work WHERE courseId = #{courseId}")
    void DeleteWork(String courseId);
}
